package org.example.chat.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 服务配置
 * @author cheval
 */
@Data
@ConfigurationProperties(prefix = "server")
public class ServerConfigProperties {

    /** 是否开启打印方法执行日志(打印执行开始和结束提示以及方法执行耗时) */
    private boolean printMethodLog = false;
    /** 系统操作日志保留天数 */
    private int logSaveDays = 30;

    @Data
    @ConfigurationProperties(prefix = "server.cache")
    public class CacheProperties {
        // 缓存过期时间，默认30分钟
        private Integer cacheExpireTime = 30;
    }

    @Data
    @ConfigurationProperties(prefix = "server.websocket")
    public class WsProperties {
        private String endpoint = "/ws";
        private int port = 9080;
    }
}

